<template>
	<view class="page">
		<view class="account-box ns-bg-color" :style="'background-image:url(' + $util.img('upload/uniapp/point/head_bg.png') + ');background-repeat: no-repeat;background-position: bottom right; background-size: 150rpx;'">
			<view class="account-text">
				<text class="iconfont iconmn_jifen_fill"></text>
				<text class="point">0</text>
			</view>
			<view class="accout-btn">
				<view @click="tooption(1)">君政券转账</view>
				<view @click="tooption(2)">君政券兑换</view>
			</view>
		</view>
		<view class="detail-box">
			<rich-text :nodes="node"></rich-text>
		</view>
	</view>
</template>

<script>
	import htmlParser from '@/common/js/html-parser';
	export default {
		data() {
			return {
				junzheng_ticket: 0,
				node: '<p>121212</p>'
			}
		},
		onLoad() {
			this.Getmsg()
		},
		onShow() {
			// this.getWallet()
		},
		methods: {
			tooption(e) {
				if (e == 1) {
					this.$util.redirectTo('/otherpages/transfer/transfer', {
						account_type: 'junzheng_ticket'
					}, 'reLaunch');
				} else {
					this.$util.redirectTo('/otherpages/transfer/exchange', {}, 'reLaunch');
				}
			},
			Getmsg() {
				this.$api.sendRequest({
					url: '/api/Ticketchange/config',
					success: res => {
						console.log(res)
						if (res.code == 0) {
							this.node = htmlParser(res.data.value.use_show)
						} else {
							uni.showToast({
								title: res.message,
								icon: 'none'
							})
						}
					}
				});
			},
		
			// getWallet(){

			// 	this.$api.sendRequest({
			// 		url: '/api/member/getWallet',
			// 		success: res => {
			// 			console.log(res)
			// 			if (res.code == 0) {
			// 				this.node = htmlParser(res.data.value.use_show)
			// 			} else {
			// 				uni.showToast({
			// 					title: res.message,
			// 					icon: 'none'
			// 				})
			// 			}
			// 		}
			// 	});
			// }
		}
	}
</script>

<style lang="scss">
	.page {
		/deep/ .fixed {
			position: relative;
			top: 0
		}

		.cart-empty {
			position: relative;
			top: 50%;
			margin-top: 104px !important;
		}

		.account-box {
			width: 702rpx;
			height: 211rpx;
			margin: 0 auto;
			border-radius: 20rpx;
			padding: 20rpx;
			box-sizing: border-box;
			margin-top: 20rpx;

			.accout-btn {
				display: flex;
				margin-top: 30rpx;

				view {
					width: 170rpx;
					height: 44rpx;
					border-radius: 22rpx;
					border: 1px solid rgba(255, 255, 255, .4);
					color: #fff;
					display: flex;
					align-items: center;
					justify-content: center;
					margin-right: 44rpx;
				}
			}

			.account-text {
				color: #fff;
				font-size: 44rpx;
				display: flex;
				align-items: center;
				margin-left: 10rpx;

				text {
					margin-right: 12rpx;
				}
			}
		}

		.detail-box {
			padding: 20rpx;

		}

		.detailed-wrap {
			background: #fff;
			border-radius: 10rpx;
			margin: 20rpx;

			.head {
				display: flex;
				height: 90rpx;

				&>view {
					flex: 1;
					text-align: left;
					padding: 0 $ns-padding;
					line-height: 90rpx;
				}
			}

			.cont {
				background: #fff;
				width: 702rpx;
				margin: 0 auto;

				.detailed-item {
					padding: 32rpx $ns-padding;
					margin: 0 $ns-margin;
					border-bottom: 1px solid #eee;
					position: relative;
					box-sizing: border-box;

					&:last-of-type {
						border-bottom: none;
					}

					.info {
						padding-right: 180rpx;

						.event {
							font-weight: bold;
							font-size: $ns-font-size-lg;
							line-height: 1.3;
							color: #333;
						}

						.time-box {
							line-height: 1;
							margin-top: 24rpx;
						}

						.time {
							font-size: $ns-font-size-base;
							color: $ns-text-color-gray;
						}
					}

					.num {
						width: 160rpx;
						position: absolute;
						right: 17rpx;
						top: 50%;
						transform: translateY(-50%);
						text-align: right;
						font-size: 40rpx;
					}
				}
			}
		}
	}
</style>
<style scoped>

</style>
